import 'package:flutter/material.dart';

import '../constants.dart' show AppColors;


enum Device{
  MAC,WIn
}

class Conversation {
  const Conversation({
    @required this.title,
    @required this.avatar,
    this.titleColor : AppColors.TitleTextColor, 
    this.des,
    @required this.updataAt,
    this.isMute :false,
    this.unreadMsgCont : 0,
    this.displayDot :false,
  }):assert(avatar !=null),
     assert(title !=null),
     assert(updataAt != null);


  final String avatar;
  final String title;
  final String des;
  final String updataAt;
  final bool isMute;
  final int titleColor;
  final int unreadMsgCont;
  final bool displayDot;

  bool isAvatarFormNet(){
    if (this.avatar.indexOf('http')>= 0 ||
    this.avatar.indexOf('https') == 0){
      return true;
    }
    return false;
  }
}

const List<Conversation> mockConversations = [
  const Conversation(
    avatar: 'assets/images/ic_album.png',
    title: '文件传输助手',
    des: '',
    updataAt: '18：10',
  ),
  const Conversation(
    avatar: 'https://randomuser.me/api/portraits/women/65.jpg',
    title: '今天实验室很寂寞',
    des: '[2条]IT万里科技IT：[动画表情]',
    updataAt: '18：09',
    unreadMsgCont: 2,
  ),
  const Conversation(
    avatar: 'assets/images/ic_card_wallet.png',
    title: '2018-2019学年人文社团联合会',
    des: '艺术团 江奉远',
    updataAt: '18：05',
    isMute: true,
  ),
  const Conversation(
    avatar: 'https://randomuser.me/api/portraits/women/60.jpg',
    title: '盼',
    des: '嗯',
    updataAt: '17：59',
  ),
  const Conversation(
    avatar: 'assets/images/ic_emotions.png',
    title: '订阅号',
    des: '测密解读：凭直觉选三张牌，测你的爱情，事业，财运！超准~',
    updataAt: '17：51',
  ),
  const Conversation(
    avatar: 'assets/images/ic_feeds.png',
    title: '微信运动',
    des: '[应用消息]',
    updataAt: '昨天',
  ),
  const Conversation(
    avatar: 'https://randomuser.me/api/portraits/women/73.jpg',
    title: 'amzarashi中国雨社基地',
    des: 'ATOU:😂😂',
    updataAt: '昨天',
    unreadMsgCont: 17,
  ),
  const Conversation(
    avatar: 'assets/images/ic_file_transfer.png',
    title: '浙江移动',
    des: '[38女王节]约惠宽带、随心靓号、...',
    updataAt: '昨天',
  ),
];

const Map<String,List<Conversation>>mockConversationData = {
  'deviceInfo':null,
  'conversations':mockConversations
};
